package com.cmc.cloud.cmclink.doc.mapper;

import com.cmc.cloud.cmclink.doc.entity.AttachmentDO;
import com.cmc.cloud.cmclink.doc.vo.sovo.attachmentvo.AttachmentCountVO;
import com.cmc.cloud.cmclink.doc.vo.sovo.attachmentvo.AttachmentRespVO;
import com.cmes.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 订舱附件表 提单附件表 单证所有附件都保存在这张表 通过类型区分 Mapper
 *
 * @author 招商轮船-管理员
 */
@Mapper
public interface AttachmentMapper extends BaseMapperX<AttachmentDO> {
    /**
     * 附件表统计信息
     * @param referenceIds  关联ids
     * @param referenceType 类型
     * @return 统计信息
     */
    List<AttachmentCountVO> selectSumByReferenceIds(@Param("referenceIds") List<Long> referenceIds, @Param("referenceType") String referenceType);

    /**
     * 特种货查询上传文件和相关属性
     * @param referenceId referenceId
     * @param referenceType referenceType
     * @return List<AttachmentRespVO>
     */
    List<AttachmentRespVO> getAttachmentInfos(@Param("referenceId") Long referenceId, @Param("referenceType") String referenceType);

}
